#include"Render/IndexBuffer.hpp"

IndexBuffer::IndexBuffer(unsigned int* data,unsigned int count)
: my_count(count)
{
   glGenBuffers(1, &my_RendererID);
   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, my_RendererID);
   glBufferData(GL_ELEMENT_ARRAY_BUFFER, count*sizeof(GLuint), data, GL_STATIC_DRAW);


}


IndexBuffer::~IndexBuffer()
{
    glDeleteBuffers(1, &my_RendererID);
}


void IndexBuffer::Bind()
{

   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, my_RendererID);
}



void IndexBuffer::UnBind()
{
   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

}